/*!
\file GraphAccessWidget.cpp
\brief Contains implementation of GraphAccessWidget.
\ingroup GUI
*/

#include"GraphAccessWidget.h" 

GraphAccessWidget::GraphAccessWidget( QWidget *parent ):QWidget( parent ){
	m_layout = new QVBoxLayout( this );
	setLayout( m_layout );
	
	QLabel *label = new QLabel( "Graph Access:", this );
	m_layout->addWidget( label );
	
	QWidget *widget = new QWidget(this);
	m_layout->addWidget(widget);
	QHBoxLayout *layout = new QHBoxLayout(widget);
	widget->setLayout(layout);
	widget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	
	QWidget *child;
	
	child = new QWidget(widget);
	child->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	layout->addWidget(child);
	QVBoxLayout *childLayout = new QVBoxLayout(child);
	child->setLayout(childLayout);
	
	label = new QLabel("Nodes", child);
	childLayout->addWidget(label);
	m_nodes = new QLCDNumber( 4, child );
	childLayout->addWidget(m_nodes);
	
	child = new QWidget(widget);
	child->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	layout->addWidget(child);
	childLayout = new QVBoxLayout(child);
	child->setLayout(childLayout);
	
	label = new QLabel("Edges", child);
	childLayout->addWidget(label);
	m_edges = new QLCDNumber( 4, child );
	childLayout->addWidget(m_edges);
	
	child = new QWidget(widget);
	child->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	layout->addWidget(child);
	childLayout = new QVBoxLayout(child);
	child->setLayout(childLayout);
	
	label = new QLabel("Total", child);
	childLayout->addWidget(label);
	m_total = new QLCDNumber( 4, child );
	childLayout->addWidget(m_total);
	
	setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
}

void GraphAccessWidget::node(){
	m_nodes->display( m_nodes->intValue()+1 );
	m_total->display( m_total->intValue()+1 );
}

void GraphAccessWidget::edge(){
	m_edges->display( m_edges->intValue()+1 );
	m_total->display( m_total->intValue()+1 );
}

